<template>
  <div class="common-layout">
    <el-container>

      <el-container>
        <el-aside width="300px">

    <!--侧栏菜单-->
    <el-row class="tac">
    <el-col :span="20">
      <el-menu
          active-text-color="#ffd04b"
          background-color="#545c64"
          class="el-menu-vertical-demo"
          default-active="2"
          text-color="#fff"
          @open="handleOpen"
          @close="handleClose"
          router
          :default-active="this.$router.path"
      >
        <el-menu-item index="4">
          <span>"科创"计算机销售管理系统</span>
        </el-menu-item>

        <el-sub-menu index="1">
          <template #title>
            <el-icon><setting /></el-icon>
            <span>商品管理</span>
          </template>
            <el-menu-item index="/AddGoods">新增商品</el-menu-item>
            <el-menu-item index="/QueryGoods">修改商品</el-menu-item>
        </el-sub-menu>
        <el-sub-menu index="2">
          <template #title>
            <el-icon><setting /></el-icon>
            <span>地址管理</span>
          </template>
          <el-menu-item index="/AddAddress">新增地址</el-menu-item>
          <el-menu-item index="/QueryAddress">修改地址</el-menu-item>
        </el-sub-menu>
        <el-sub-menu index="3">
          <template #title>
            <el-icon><setting /></el-icon>
            <span>新闻管理</span>
          </template>
          <el-menu-item index="/AddNews">新增新闻</el-menu-item>
          <el-menu-item index="/QueryNews">修改新闻</el-menu-item>
        </el-sub-menu>
        <el-menu-item index="4" disabled>
          <el-icon><document /></el-icon>
          <span>Navigator Three</span>
        </el-menu-item>
        <el-menu-item index="5">
          <el-icon><setting /></el-icon>
          <span>Navigator Four</span>
        </el-menu-item>
      </el-menu>
    </el-col>
    </el-row>
        </el-aside>
        <el-main>
          <router-view/>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script lang="ts" setup>
//菜单头
import { ref } from 'vue'

//1.定义变量 常量 ref:给一个变量 赋值  ref.value  {value:'1'}
const activeIndex2 = ref('1')

//函数lambda 表达式
const handleSelect = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}

//侧栏菜单
import {
  Document,
  Menu as IconMenu,
  Location,
  Setting,
} from '@element-plus/icons-vue'
const handleClose = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
</script>
<style scoped lang="scss">

</style>